<?php
class admin_userModel extends baseModel{
	protected $table = 'admin_user';

	public function info($username) {

		$sql="
            SELECT A.*,B.*,B.name as gname
            FROM {$this->model->pre}admin_user A 
            LEFT JOIN {$this->model->pre}admin_group B ON A.gid = B.gid
            WHERE username='{$username}'
            ORDER BY A.uid DESC
            ";
        $info=$this->model->query($sql);
        return  $info[0];
    }

    public function edit($data) {
        return $this->update('uid='.$data['uid'],$data);
    }


}